package com.health.mapp.impl;

import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;

import com.health.db.model.VoiceOnDemondExample;
import com.health.db.service.user.IVoiceOnDemondService;
import com.health.mapp.bean.Header;
import com.health.mapp.bean.QueryVoiceOnDemondReq;
import com.health.mapp.bean.QueryVoiceOnDemondResp;
import com.health.mapp.utils.Response;
/**
 *专家讲堂
 *每日专家语音小课堂。
 *每月一次专家健康讲座 增加与健康专家交流机会、会员免费参与
 * @author YuChong
 *
 */
public class QueryVoiceOnDemondImpl implements ActionInterface {

	private static Logger logger = Logger.getLogger(QueryVoiceOnDemondImpl.class);
	
	private IVoiceOnDemondService voiceOnDemondService;
	@Override
	public Response execute(Header header, Object reqBean) throws Exception {
	 
		
		QueryVoiceOnDemondReq req = (QueryVoiceOnDemondReq) reqBean;
		QueryVoiceOnDemondResp _resp = new QueryVoiceOnDemondResp();
		
		VoiceOnDemondExample example = new VoiceOnDemondExample();
/*		Integer pageNo = req.getPageNo();
	    Integer pageNum = req.getPageNum();
        //设置分页查询
        if(null!=pageNo&&null!=pageNum){
        	example.setOffset((pageNo.intValue()-1)*pageNum.intValue());
        	example.setPageSize(pageNum.intValue());
		}
*/		if (StringUtils.isNotEmpty(req.getDocId())) 
		{
			example.setStuffId(Long.valueOf(req.getDocId()));
		}else if (StringUtils.isNotEmpty(req.getRecId())) {
			example.setRecid(Long.valueOf(req.getRecId()));
		}
		_resp.setVoiceOnDemond( voiceOnDemondService.selectByExample(example));
		_resp.setPageNo(1);
		_resp.setPageNo(10);
		
		return _resp;
	}
	public IVoiceOnDemondService getVoiceOnDemondService() {
		return voiceOnDemondService;
	}
	public void setVoiceOnDemondService(IVoiceOnDemondService voiceOnDemondService) {
		this.voiceOnDemondService = voiceOnDemondService;
	}
	
}

